package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BdCustSupplierMapper;
import com.ruoyi.system.domain.BdCustSupplier;
import com.ruoyi.system.service.IBdCustSupplierService;
import com.ruoyi.common.core.text.Convert;

/**
 * 客商Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-08
 */
@Service
public class BdCustSupplierServiceImpl implements IBdCustSupplierService 
{
    @Autowired
    private BdCustSupplierMapper bdCustSupplierMapper;

    /**
     * 查询客商
     * 
     * @param pkCustSup 客商主键
     * @return 客商
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public BdCustSupplier selectBdCustSupplierByPkCustSup(String pkCustSup)
    {
        return bdCustSupplierMapper.selectBdCustSupplierByPkCustSup(pkCustSup);
    }

    /**
     * 查询客商列表
     * 
     * @param bdCustSupplier 客商
     * @return 客商
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public List<BdCustSupplier> selectBdCustSupplierList(BdCustSupplier bdCustSupplier)
    {
        return bdCustSupplierMapper.selectBdCustSupplierList(bdCustSupplier);
    }

    /**
     * 新增客商
     * 
     * @param bdCustSupplier 客商
     * @return 结果
     */
    @Override
    public int insertBdCustSupplier(BdCustSupplier bdCustSupplier)
    {
        return bdCustSupplierMapper.insertBdCustSupplier(bdCustSupplier);
    }

    /**
     * 修改客商
     * 
     * @param bdCustSupplier 客商
     * @return 结果
     */
    @Override
    public int updateBdCustSupplier(BdCustSupplier bdCustSupplier)
    {
        return bdCustSupplierMapper.updateBdCustSupplier(bdCustSupplier);
    }

    /**
     * 批量删除客商
     * 
     * @param pkCustSups 需要删除的客商主键
     * @return 结果
     */
    @Override
    public int deleteBdCustSupplierByPkCustSups(String pkCustSups)
    {
        return bdCustSupplierMapper.deleteBdCustSupplierByPkCustSups(Convert.toStrArray(pkCustSups));
    }

    /**
     * 删除客商信息
     * 
     * @param pkCustSup 客商主键
     * @return 结果
     */
    @Override
    public int deleteBdCustSupplierByPkCustSup(String pkCustSup)
    {
        return bdCustSupplierMapper.deleteBdCustSupplierByPkCustSup(pkCustSup);
    }
}
